package com.wanmait.zaisousuo.service.Impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wanmait.zaisousuo.service.SolutionService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import com.wanmait.zaisousuo.mapper.SolutionMapper;
import com.wanmait.zaisousuo.pojo.Solution;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class SolutionServiceImpl implements SolutionService {

    @Resource
    private SolutionMapper solutionMapper;


    @Override
    public void insert(Solution solution) {
        solutionMapper.insert(solution);
    }

    @Override
    public void update(Solution object) {

    }

    @Override
    public void delete(Integer id) {
      solutionMapper.updateBySolutionIdDelete(id);
    }

    @Override
    public void delete(String ids) {

    }

    @Override
    public Solution findById(Integer id) {
        return null;
    }

    @Override
    public List<Solution> findAll() {
        return null;
    }

    @Override
    public List<Solution> findAll(Solution object) {

        return null;
    }

    @Override
    public int getDataCount() {
        return 0;
    }

    @Override
    public int getDataCount(Solution object) {
        return 0;
    }

    @Override
    public PageInfo<Solution> findList(int pageNum) {
        return null;
    }

    @Override
    public PageInfo<Solution> findAllSolutionByGarbageId(Integer id,Integer pageNum) {
        int pageSize=2;
        PageHelper.startPage(pageNum,pageSize);
        List<Solution> allSolution=solutionMapper.listAllSoutionById(id);
        PageInfo pageInfo=new PageInfo<>(allSolution);
        return pageInfo;
    }

    @Override
    public List<Solution> findAllSolutionById(Integer id) {
        return solutionMapper.listAllSoutionById(id);
    }
}
